import axios from 'axios'

interface BaseRes {
    stat?: string
    id?:string
}

interface Pill{
    name: string
    email: string
    time: string
    content: string
    tip: string
    id?:string
}

export async function addPill(pill:Pill) {
    let result = await axios.post<BaseRes>('/api/add',pill)
    console.log(result.data);
    return result.data
}

export async function getPill(id:{}) {
    let result = await axios.post<BaseRes>('/api/get',id)
    console.log(result.data)
    return result.data
}
